package mornd.test1.comps;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author: mornd
 * @dateTime: 2023/5/5 - 14:56
 */
@Slf4j
public class Bean2 implements ApplicationContextAware, BeanFactoryAware {
    // GenericApplicationContext
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        log.debug(this + "获取容器对象：{}", applicationContext);
    }

    // DefaultListableBeanFactory
    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        log.debug(this + "获取容器的BeanFactory对象：{}", beanFactory);
    }
}
